<?php
if (!defined("_INDEX")) { header("Location: /"); die; }

require_once ADMIN.DS."/head.php";
?>
<h1>Страховые услуги</h1><br />
<div class='floating'><a href='/admin/services/add'>Добавить услугу</a></div>
<table cellpadding='0' cellspacing='0' class='list'>
	<tr class='table_header'>
		<td width='50px'>ID</td>
		<td width='300px'>Услуга</td>
		<td width='200px' class='actions'>Действия</td>
	</tr><?php
		$services = $db->getTable("select * from `services` order by `service_id`");
		foreach ($services as $service)
		{
			echo "<tr><td>$service[service_id]</td>";
			echo "<td>";
				echo $service['fix'] == 'prefix' ? "Страхование ".mb_strtolower($service['name'],"utf-8") : (
					$service['fix'] == 'postfix' ? $service['name']." страхование" : $service['name']
				);
			echo "</td>";
			echo "<td class='actions'><a href='/admin/services/edit/$service[service_id]' class='edit'>Редактировать</a> | <a href='/admin/services/delete/$service[service_id]' class='delete'>Удалить</a></td></tr>";
		}
?></table>

<?php require_once ADMIN.DS."/footer.php"; ?>